/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mycompany.delivery.transfers;

import com.mycompany.delivery.dto.DTOState;
import com.mycompany.delivery.entities.State;

/**
 *
 * @author mhunek
 */
public class EnumT {
    public static State DTOStateToState(DTOState dtoS) {
        if(dtoS == DTOState.DELIVERED) return  State.DELIVERED;
        if(dtoS == DTOState.NOTDELIVERED) return  State.NOTDELIVERED;
        if(dtoS == DTOState.RECEIVEDBYCOURIER) return  State.RECEIVEDBYCOURIER;
        return State.UNPROCESSED;
    }
    
      public static DTOState StateToDTOState(State state) {
        if(state == State.DELIVERED) return  DTOState.DELIVERED;
        if(state == State.NOTDELIVERED) return  DTOState.NOTDELIVERED;
        if(state == State.RECEIVEDBYCOURIER) return  DTOState.RECEIVEDBYCOURIER;
        return DTOState.UNPROCESSED;
    }
}
